<%@ page language="java" contentType="text/html; charset=utf-8" errorPage="/404.jsp" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>详情界面</title>
    <style type="text/css">
        @import url("<c:url value='/css/main.css'/>");
    </style>
</head>


<body>
<div class="div_main">
    <div class="div_header">租凭合同信息管理-租凭合同详情</div>
    <h1 align="center">
        <a href="${pageContext.request.contextPath}/contract/list.action">
            返回首页
        </a>
    </h1>
    <c:if test="${not empty contract}">
        <div class="div_data">
            <table class="tab_list">
                <tr>
                    <th>编号</th>
                    <th>租户编号</th>
                    <th>房屋编号</th>
                    <th>押金</th>
                    <th>签署时间</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>总金额</th>
                    <th>状态</th>
                    <th>付款方式</th>
                    <th>操作</th>
                </tr>

                    <tr>
                        <td>${contract.cid}</td>
                        <td>${contract.lid}</td>
                        <td>${contract.hid}</td>
                        <td>${contract.ccash}</td>
                        <td>${contract.ccreatetimeStr}</td>
                        <td>${contract.cstarttimeStr}</td>
                        <td>${contract.cendtimeStr}</td>
                        <td>${contract.ctotalmoney}</td>
                        <td>${contract.cstatus}</td>
                        <td>${contract.ctype}</td>
                        <td>
                            &nbsp;&nbsp;
                            <a href="${pageContext.request.contextPath}/contract/getOneByCid.action?cid=${contract.cid}&method=update">编辑</a>

                            &nbsp;&nbsp;
                            <a href="#" onclick="confirmDelete(${contract.cid})">删除</a>
                            <script>
                                function confirmDelete(id) {
                                    if (confirm("确定要删除码？")) {
                                        window.location = "${pageContext.request.contextPath}/contract/deleteOneByCid.action?cid=" + id;
                                        // 重定向
                                    }
                                    return false;
                                }
                            </script>
                        </td>
                    </tr>

            </table>
        </div>
    </c:if>


</div>
</body>


</html>

